package cc.geguo.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import java.util.Map;

import cc.geguo.action.bean.User;

/**
 * Created by 13687 on 2017/1/8.
 */
public class UserAction extends ActionSupport {

	public UserAction() {
		System.out.println("用户访问 Action创建");
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	// TODO: 2017/1/8 登陆
	private User user;

	public String login(){
		System.out.println(user.getUserName());
		System.out.println(user.getPwd());

		ActionContext actionContext=ActionContext.getContext();
		Map<String, Object> req = actionContext.getContextMap();
		Map<String, Object> seesion = actionContext.getSession();
		Map<String, Object> application = actionContext.getApplication();

//		保存
		req.put("request_data","request_data");
		seesion.put("seesion_data","session_data");
		application.put("application_data","application_data");
		return "login";
	}

}
